package com.xinqi.modules.sys.stats.controller.inner;


import com.xinqi.common.base.response.PageInfo;
import com.xinqi.common.base.response.Param;
import com.xinqi.common.base.response.R;
import com.xinqi.modules.sys.stats.dto.req.SchoolTeachingDayStQueryDTO;
import com.xinqi.modules.sys.stats.dto.rsp.SchoolTeachingDayStResultDTO;
import com.xinqi.modules.sys.stats.service.SchoolTeachingDayStService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 学校教学数据统计内部控制层
 *
 * @author: wenjie
 * @date: 2023/08/24
 */
@Hidden
@RestController
@RequestMapping("/inner/school-teaching-day-st")
@RequiredArgsConstructor
public class SchoolTeachingDayStInnerController {
    private final SchoolTeachingDayStService schoolTeachingDayStService;

    /**
     * 学校教学数据统计-分页
     */
    @GetMapping("/page")
    public R<PageInfo<SchoolTeachingDayStResultDTO>> page(Param pageable, SchoolTeachingDayStQueryDTO dto) {
        PageInfo<SchoolTeachingDayStResultDTO> page = schoolTeachingDayStService.page(pageable, dto);
        return R.data(page);
    }

    /**
     * 学校教学数据统计-详情
     */
    @GetMapping("/{id}")
    public R<SchoolTeachingDayStResultDTO> findById(@PathVariable("id") Long id) {
        SchoolTeachingDayStResultDTO dto = schoolTeachingDayStService.findById(id);
        return R.data(dto);
    }
}
